package com.imooc.luckymoney.util;

import com.imooc.luckymoney.entity.Luckymoney;
import com.alibaba.fastjson.JSON;
import com.imooc.luckymoney.entity.Result;


public class LuckymoneyJsonUtil {
    public static Result<Luckymoney> getResult(String jsonstring, Class cls) {

        Result<Luckymoney> result = null;

        try {

            result = (Result)JSON.parseObject(jsonstring, cls);

        } catch (Exception e) {
            e.printStackTrace();
        }

        return result;

    }
    public static Luckymoney getLuckymoney(String jsonstring, Class cls) {

        Luckymoney luckymoney = null;

        try {

            luckymoney = (Luckymoney)JSON.parseObject(jsonstring, cls);

        } catch (Exception e) {
            e.printStackTrace();
        }

        return luckymoney;

    }
}

